package com.qinglei.recoup.common.config;

import com.qinglei.recoup.common.domain.CommonConstant;
import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.DirectExchange;
import org.springframework.amqp.core.Queue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 测试使用 - 可以删除
 */
@Configuration
public class RabbitConfig {

    @Bean
    public Queue RadarDataQueue() {
        return new Queue(CommonConstant.MQ_RADAR_DATA_QUEUE,true);
    }

    @Bean
    DirectExchange RecoupDirectExchange() {
        return new DirectExchange(CommonConstant.MQ_RECOUP_DIRECT_EXCHANGE,true,false);
    }

    @Bean
    Binding bindingDirect() {
        return BindingBuilder.bind(RadarDataQueue()).to(RecoupDirectExchange()).with(CommonConstant.MQ_RADAR_DATA_ROUTING);
    }

}
